<%@ page import="cn.lxs.web.po.User" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.List" %><%--
  Created by IntelliJ IDEA.
  User: 君未洋
  Date: 2021/5/4
  Time: 11:03
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>小练习</title>
</head>
<body>
<%
    List list = new ArrayList();
    list.add(new User("王", "23"));
    list.add(new User("里", "223"));
    list.add(new User("狗", "2323"));
    request.setAttribute("list", list);
%>
<table border="1" width="500" align="center">
    <tr>
        <th>编号</th>
        <th>姓名</th>
        <th>年龄</th>
    </tr>
    <c:forEach items="${requestScope.list}" var="user" varStatus="s">
        <tr>
            <td>${s.count}</td>
            <td>${user.username}</td>
            <td>${user.age}</td>
        </tr>
    </c:forEach>
</table>
</body>
</html>
